package com.ds.service;

import com.ds.mapper.StudentMapper;
import com.ds.pojo.Student;
import org.apache.ibatis.annotations.Mapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

/**
 * @program: Spring-Study
 * @description:
 * @author: Dawson.Zhang
 * @create: 2020-04-05
 **/
@Service
@Transactional
public class StudentServiceImpl implements StudentService {
    @Autowired
    StudentMapper studentMapper;

    public List<Student> getAll() {
        return studentMapper.getAll();
    }

    public void sqy() {
        System.out.println("111");
    }

    public int insert(Student student) throws Exception {
        int i = studentMapper.insert(student);
        int b = 2 / 0;
        return i;
    }
}
